import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import "@/styles/index.scss"; // global css

import App from './App'
import store from './store'
import router from './router'
import directive from '@/utils/directive.js';
import '@/utils/walden'
import '@/icons' // icon
import '@/permission' // permission control

import MescrollVue from 'mescroll.js/mescroll.vue'
import { apiUrl, objKeySort, Md5 } from "@/utils/public";
import _ from 'lodash'
Vue.prototype._ = _
Vue.component('mescroll-vue', MescrollVue);

Vue.use(ElementUI, { size: 'small' })
Vue.use(directive);

Vue.config.productionTip = false
Vue.prototype.$beSubmt = function (data) {
  return Object.assign(
    {
      sign: Md5(
        objKeySort(Object.assign(apiUrl().name), data) +
        apiUrl().appsecret
      )
    },
    apiUrl().name,
    data
  );
}

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})